package com.xiaoma.myaudience.biz.model;

import android.content.ContentValues;
import android.database.Cursor;

import com.xiaoma.myaudience.util.model.BaseColumnInfo;

/***
 * 搜索记录
 * @author xali
 *
 */
public class SearchHistoryInfo extends BaseColumnInfo{
	/**记录内容*/
	public final static String KEYWORD = "keyword";
	/**最后修改时间*/
	public final static String LASTUPDATETIME = "lastupdatetime";
	
	/**记录内容*/
	public String mKeyword;	
	/**最后修改时间*/
	public String mLastUpdateTime;	
	
	@Override
	public void readFromCursor(Cursor cursor) {
		// TODO Auto-generated method stub
		super.readFromCursor(cursor);
		
		int index = -1;
        if ((index = cursor.getColumnIndex(KEYWORD)) != -1) {
        	mKeyword = cursor.getString(index);
            index = -1;
        }
        if ((index = cursor.getColumnIndex(LASTUPDATETIME)) != -1) {
        	mLastUpdateTime = cursor.getString(index);
            index = -1;
        }
	}
	
	@Override
	public ContentValues generateContentValues() {
		ContentValues values = new ContentValues();
		values.put(KEYWORD, mKeyword);
		values.put(LASTUPDATETIME, mLastUpdateTime);
		return values;
	}
	
}